$(document).ready(
		function() {

			var loc = location.search.substring(1, location.search.length);
			var params = loc.split("&");
			param_value = params[0].substring(params[0].indexOf('=') + 1);
			acao = document.getElementById("formCadastro").getAttribute(
					"action");
			var paramsForms = acao.split("?");
			

			if ((param_value == "comprarIngresso")
					|| (param_value == "finalizarIngresso")
					|| (param_value == "atualizarValores")) {
				opentab(2);
			} else{
				opentab(1);
			}

		});

function opentab(num) {
	$("#content > div").hide();
	$("#content > div:eq(" + (num - 1) + ")").fadeIn();
	$("#tabs > a").css("background", "#333399");
	$("#tabs > a").css("color", "silver");
	$("#tabs > a:eq(" + (num - 1) + ")").css("background",
			"url('imagens/icones/imagemBotaoHover.png')");
	$("#tabs > a:eq(" + (num - 1) + ")").css("color", "black");
}
